[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
INPUTSTR SEXP1,VAR,IEXP1,IEXP2,SEXP2,IEXP3
Function
Prompt the user for a string of text in a specific format.
Syntax
INPUTSTR prompt,var,color,len,valid,flags
prompt - A string expression with the prompt to display to the user.
var - The variable in which to store the user's input.
colorAn - integer expression with the color to display the prompt in.
len - An integer expression with maximum length (1-256) of text to
input.
valid - A string expression with the valid characters that the user
may enter.
flags - An integer expression with flags to modify how the statement
works.
Remarks
This statement will accept a string of input from the user, up to the
length defined. The prompt parameter will be displayed to the user in
the specified color before accepting input. Only characters found in
the valid parameter will be accepted. However, the flags parameter may
affect how prompt is displayed and the valid characters that are
accepted. Individual flags may be added together as needed.
Several functions exist to easily specify commonly used valid character
masks. They are:
MASK_ALNUM() - A through Z, a through z, and 0 through 9
MASK_ALPHA() - A through Z and a through z
MASK_ASCII() - Space (ASCII 32) through tilde (ASCII 126)
MASK_FILE() - Legal file name characters (DOS)
MASK_NUM() - 0 through 9
MASK_PATH() - Legal path names (DOS)
MASK_PWD() - Legal password characters
Defined flag values are:
AUTO -Auto press enter after 20 seconds of no user input
DEFS -Use default values
ECHODOTS -Echo dots instead of user input
ERASELINE -Erase the current line when user presses enter
FIELDLEN -Displays "()" to show input field width if ANSI enabled
GUIDE -Displays "()" for FIELDLEN if ANSI not enabled
HIGHASCII -Allow high ascii characters
LFAFTER -Send an extra line feed after user presses enter
LFBEFORE -Send an extra line feed before prompt display
NEWLINE -Send a line feed after user presses enter
NOCLEAR -Don't clear field at first keypress regardless of ANSI
STACKED -Allow semi-colons and spaces to be input
UPCASE -Force user input to upper case
WORDWRAP -Save the text at the end of the line
YESNO -Only allow international yes/no responses
To use these flag constants simply add the ones you need together.
Examples
BOOLEAN b
DATE d
INTEGER i
MONEY m
STRING s
TIME t
INPUTSTR "Enter BOOLEAN",b,@X0E,1,"10",LFBEFORE+NEWLINE
INPUTSTR "Enter DATE",d,@X0F,8,"0123456789-",NEWLINE+NOCLEAR
INPUTSTR "Enter INTEGER",i,@X07,20,MASK_NUM(),NEWLINE
INPUTSTR "Enter MONEY",m,@X08,9,MASK_NUM()+".",NEWLINE+DEFS+FIELDLEN
INPUTSTR "Enter STRING",s,@X09,63,MASK_ASCII(),NEWLINE+FIELDLEN+GUIDE
INPUTSTR "Enter TIME",t,@X0A,5,"0123456789"+":",NEWLINE+LFAFTER
PRINTLN b," ",d," ",i
PRINTLN m," ",s," ",t
See Also:
INPUT
INPUT...
INPUTTEXT
PROMPTSTR
MASK_...()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson